package com.duqc.redis.lock;

/**
 * @ClassName RedisLockTypeEnum
 * @Description RedisLockTypeEnum
 * @Author duqc
 * @Date 2022/10/26
 **/
public enum RedisLockTypeEnum {
    /**
     * 自定义key前缀，一次区分开不同的业务不同的功能模块
     */
    ONE("Business1", "Test1"),
    TWO("Business2", "Test1");

    private final String code;
    private final String desc;

    RedisLockTypeEnum(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public String getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }

    public String getUniqueKey(String key) {
        return String.format("%s:%s", this.getCode(), key);
    }

}
